package com.tengju.user.domain.model.sign;

import com.tengju.user.domain.model.archive.letax.IdentityType;
import com.tengju.user.domain.model.user.StarLevelEnum;
import com.tengju.user.domain.model.user.UserIdCode;
import com.tengju.user.domain.model.user.UserInfo;
import com.tengju.user.domain.model.user.UserStarInfo;
import com.tengju.user.domain.shared.BasePage;

import java.time.LocalDateTime;
import java.util.List;

public interface StarSignInfoRepository {

    StarSignInfo getById(SignId signId);

    StarSignInfo getByIdCode(UserIdCode idCode);

    StarSignInfo getByIdCodeAndBeforeLevel(UserIdCode idCode, StarLevelEnum beforeStarLevel);

    List<StarSignInfo> getHistoryByIdCode(UserIdCode idCode);

    List<StarSignInfo> batchGetByIdCodes(List<UserIdCode> targetIdCodes);

    List<StarSignInfo> getSignStatusByIdCode(List<UserIdCode> targetIdCodes);

    List<StarSignInfo> batchGetByIdCodesSignStatus(List<UserIdCode> targetIdCodes,StarSignStatus status);

    void singleCasUpdate(StarSignInfo starSignInfo,Integer curStep);

    List<StarSignInfo> batchGetByIds(List<Long> idList);

    BasePage<StarSignInfo> listPageStarSignInfo(UserIdCode idCode, String mobile, String nickName, String auditDesc, StarAuditStatEnum auditStatus, List<StarSignStepEnum> signStatusList, Byte handleType, Integer originStarLevel, Integer targetStarLevel, Byte blackListFlag, Integer offset, Integer pageSize);

    BasePage<Long> listPageBlackUser(UserIdCode idCode, String mobile, String nickName, Integer starLevel, Byte agreementStatus, LocalDateTime agreementFromDate, LocalDateTime agreementEndDate, Byte blackListFlag, Integer offset, Integer pageSize);

    Integer countStep(Integer step);

    List<StarSignInfo> listStep(Integer step, long startId, Integer limit);


    Integer countExpireRecord(LocalDateTime expireDate);

    List<StarSignInfo> listExpireRecord(LocalDateTime expireDate, int limit);

    void insert(StarSignInfo starSignInfo);

    IdentityType getIdentityType(UserIdCode idCode);

    int countStarNotice(LocalDateTime noticeDate, StarChangeNoticeTypeEnum noticeTypeEnum);

    List<StarChangeNoticeRecord> listStarNotice(LocalDateTime noticeDate, StarChangeNoticeTypeEnum noticeTypeEnum, Integer offset, Integer limit);

    List<UserStarInfo> listUserStarInfoByIdCodes(List<Long> idCodes);

    List<UserStarInfo> listUserStarInfo(List<UserInfo> userInfos);

    List<SignStatisticsDetail> listSignStatisticsDetail();

    StarSignInfo getNewSignInfo(UserIdCode idCode);
}
